home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / lisp / ilisp / ilisp-mnb.el < prev    next >
Encoding:
Text File  |  1995-01-26  |  5.2 KB  |  163 lines

  1. ;;; -*- Mode: Emacs-Lisp -*-
  2.  
  3. ;;; ilisp-mnb.el --
  4.  
  5. ;;; This file is part of ILISP.
  6. ;;; Version: 5.7
  7. ;;;
  8. ;;; Copyright (C) 1990, 1991, 1992, 1993 Chris McConnell
  9. ;;;               1993, 1994 Ivan Vasquez
  10. ;;;               1994, 1995 Marco Antoniotti and Rick Busdiecker
  11. ;;;
  12. ;;; Other authors' names for which this Copyright notice also holds
  13. ;;; may appear later in this file.
  14. ;;;
  15. ;;; Send mail to 'ilisp-request@lehman.com' to be included in the
  16. ;;; ILISP mailing list. 'ilisp@lehman.com' is the general ILISP
  17. ;;; mailing list were bugs and improvements are discussed.
  18. ;;;
  19. ;;; ILISP is freely redistributable under the terms found in the file
  20. ;;; COPYING.
  21.  
  22.  
  23.  
  24.  
  25. ;(require 'ilisp-key)
  26.  
  27. (defvar lisp-general-menu-map (make-sparse-keymap "Lisp")
  28.   "Keymap for main LISP menu")
  29.  
  30.  
  31. (defkey-ilisp [menu-bar lisp]
  32.     (cons "Lisp" lisp-general-menu-map))
  33.  
  34.  
  35. (defkey-ilisp [menu-bar lisp repair]
  36.     '("Repair Connection" . repair-ilisp))
  37.  
  38. (defkey-ilisp [menu-bar lisp reset]
  39.     '("Reset Connection" . reset-ilisp))
  40.  
  41. (defkey-ilisp [menu-bar lisp comment-region]
  42.   '("Comment Region" . comment-region))
  43.  
  44. ;;; (defkey-ilisp [menu-bar lisp sep-1]
  45. ;;;   '("-" . ilisp-nop))
  46.  
  47. (defkey-ilisp [menu-bar lisp macroexpand]
  48.   '("Macroexpand" . macroexpand-lisp))
  49.  
  50. (defkey-ilisp [menu-bar lisp macroexpand-1]
  51.   '("Macroexpand 1" . macroexpand-1-lisp))
  52.  
  53. (defkey-ilisp [menu-bar lisp set-package]
  54.   '("Set Buffer Package" . set-package-lisp))
  55.    
  56. (defkey-ilisp [menu-bar lisp arglist]
  57.   '("Arglist" . arglist-lisp))
  58.  
  59. (defkey-ilisp [menu-bar lisp documentation]
  60.   '("Documentation" . documentation-lisp))
  61.  
  62. (defkey-ilisp [menu-bar lisp describe]
  63.   '("Describe" . describe-lisp))
  64.  
  65. (defkey-ilisp [menu-bar lisp inspect]
  66.   '("Inspect" . inspect-lisp))
  67.  
  68. (defkey-ilisp [menu-bar lisp eval-defun]
  69.   '("Eval Defun" . eval-defun-and-go-lisp))
  70.  
  71. (defkey-ilisp [menu-bar lisp start-inferior-lisp]
  72.     '("Start Lisp"
  73.       "Starts an inferior lisp asking for a dialect name"
  74.       . run-ilisp))
  75.  
  76.  
  77. (defun ilisp-nop () nil)
  78.  
  79. ;;; Make sure the menu items are properly marked.
  80. ;;; Checking for 'ilisp-buffer' is very crufty, but I think it is OK
  81. ;;; for the time being. The function 'ilisp-initialized' is not very
  82. ;;; good for this.
  83.  
  84. (put 'macroexpand-lisp 'menu-enable 'ilisp-buffer)
  85. (put 'macroexpand-1-lisp 'menu-enable 'ilisp-buffer)
  86. (put 'set-package-lisp 'menu-enable 'ilisp-buffer)
  87. (put 'arglist-lisp 'menu-enable 'ilisp-buffer)
  88. (put 'documentation-lisp 'menu-enable 'ilisp-buffer)
  89. (put 'inspect-lisp 'menu-enable 'ilisp-buffer)
  90. (put 'describe-lisp 'menu-enable 'ilisp-buffer)
  91. (put 'eval-defun-and-go-lisp 'menu-enable 'ilisp-buffer)
  92. (put 'run-ilisp 'menu-enable '(null ilisp-buffer))
  93. (put 'reset-ilisp 'menu-enable 'ilisp-buffer)
  94. (put 'repair-ilisp 'menu-enable 'ilisp-buffer)
  95.  
  96. (put 'comment-region 'menu-enable 'mark-active)
  97.  
  98.  
  99. ;;; ilisp-update-menu --
  100. ;;; Update the status of the menu "Lisp".
  101.  
  102. ;; This variable should disappear!
  103.  
  104. (defvar ilisp-process-active-p nil
  105.   "Kludge to keep track whether the Inf. Lisp is active or not.")
  106.  
  107. (defun ilisp-update-menu (status)
  108.   (if (eq status 'exit)
  109.       (progn
  110.     ;; (setq ilisp-process-active-p nil)
  111.     (put 'macroexpand-lisp 'menu-enable 'ilisp-buffer)
  112.     (put 'macroexpand-1-lisp 'menu-enable 'ilisp-buffer)
  113.     (put 'set-package-lisp 'menu-enable 'ilisp-buffer)
  114.     (put 'arglist-lisp 'menu-enable 'ilisp-buffer)
  115.     (put 'documentation-lisp 'menu-enable 'ilisp-buffer)
  116.     (put 'inspect-lisp 'menu-enable 'ilisp-buffer)
  117.     (put 'describe-lisp 'menu-enable 'ilisp-buffer)
  118.     (put 'eval-defun-and-go-lisp 'menu-enable 'ilisp-buffer)
  119.     ;; (put 'run-ilisp 'menu-enable '(and (null ilisp-buffer)
  120.     ;;                                ilisp-process-active-p)
  121.     (put 'run-ilisp 'menu-enable (null ilisp-buffer))
  122.     (put 'reset-ilisp 'menu-enable 'ilisp-buffer)
  123.     (put 'repair-ilisp 'menu-enable 'ilisp-buffer)
  124.     )
  125.     ;; no-op otherwise
  126.     ))
  127.  
  128. ;;;(setplist 'lisp-command-menu nil)
  129. ;;;(def-menu 'lisp-command-menu
  130. ;;;    "Lisp"
  131. ;;;  "These ILISP commands are available on the menu:"
  132. ;;;  '(
  133. ;;;    ("Break        Interupt current lisp."  
  134. ;;;     (progn (switch-to-lisp t)
  135. ;;;        (interrupt-subjob-ilisp)))
  136. ;;;    ("Doc          Menu of commands to get help on variables, etc."
  137. ;;;     documentation-lisp-command-menu)
  138. ;;;    ("Xpand        macroexpand-lisp."        macroexpand-lisp)
  139. ;;;    ("Eval         Eval the surrounding defun." eval-defun-lisp)
  140. ;;;    ("1E&G         Eval defun and goto Inferior LISP." eval-defun-and-go-lisp)
  141. ;;;    (";            Comment the region."   comment-region-lisp)
  142. ;;;    (")            find-unbalanced-lisp parens." find-unbalanced-lisp)
  143. ;;;    ("]            close-all-lisp parens that are open." close-all-lisp)
  144. ;;;    ("Trace        Traces the previous function symbol." trace-lisp)
  145. ;;;    )
  146. ;;;  )
  147.  
  148. ;;;(setplist 'documentation-lisp-command-menu nil)
  149. ;;;(def-menu 'documentation-lisp-command-menu
  150. ;;;    "Lisp help"
  151. ;;;  "These commands are available for examining Lisp structures:"
  152. ;;;  '(
  153. ;;;    ("UDoc         Get user's documentation string." documentation-lisp)
  154. ;;;    ("Rglist       Get the arglist for function." arglist-lisp)
  155. ;;;    ("Insp         Inspect the current sexp." inspect-lisp)
  156. ;;;    ("1Insp        Prompts for something to inspect." (inspect-lisp -4))
  157. ;;;    ("Descr        Describe the current sexp." describe-lisp)
  158. ;;;    ("1Descr       Prompts for something to describe." (describe-lisp -4))
  159. ;;;    )
  160. ;;;  )
  161.  
  162. (provide 'ilisp-mnb)
  163.